﻿package com.bieyang.anjia.ui.activity;

import android.os.Bundle;
import android.os.Handler.Callback;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.onekeyshare.OnekeyShare;

import com.bieyang.anjia.R;

public class AcShare extends BaseActivity implements OnClickListener, Callback {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ac_share);
		ShareSDK.initSDK(this);
		findViewById(R.id.btnShare).setOnClickListener(this);
		findViewById(R.id.btnBack).setOnClickListener(this);
		//		OnekeyShare oks = new OnekeyShare();
		//		// 分享时Notification的图标和文字
		//		oks.setNotification(R.drawable.icon,
		//				AcShare.this.getString(R.string.app_name));
		//		// text是分享文本，所有平台都需要这个字段
		//		oks.setText("分享内容");
		//		
		//		oks.show(AcShare.this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.btnBack:
			finish();
			break;
		case R.id.btnShare:
			OnekeyShare oks = new OnekeyShare();
			// 分享时Notification的图标和文字
			oks.setNotification(R.drawable.icon, AcShare.this.getString(R.string.app_name));
			// text是分享文本，所有平台都需要这个字段
			oks.setText("分享安加");

			oks.show(v.getContext());
			break;
		}
	}

	@Override
	protected void onDestroy() {
		ShareSDK.stopSDK(this);
		super.onDestroy();

	}

	@Override
	public boolean handleMessage(Message msg) {
		// TODO Auto-generated method stub
		return false;
	}
}
